'use strict';var _inherits = require('babel-runtime/helpers/inherits')['default'];var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];exports.__esModule = true;var _baseJs = require(

'./base.js');var _baseJs2 = _interopRequireDefault(_baseJs);var _nodeCrontab = require(
'node-crontab');var _nodeCrontab2 = _interopRequireDefault(_nodeCrontab);

var async = require('async');

/*var crontab = require('crontab');*/var _default = (function (_Base) {_inherits(_default, _Base);function _default() {_classCallCheck(this, _default);_Base.apply(this, arguments);}


  /**
   * index action
   * @return {Promise} []
   */_default.prototype.

  indexAction = function indexAction() {
    /* var  wea = require('../service/weaService');
     wea.getCityAll();*/

    /* var ff = require('../service/test');
     ff.orientotest();*/
    /*var async = require('async');
    async.series([wea.orientotest(),wea.odata()]);*/
    /*wea.orientotest(function(data){
        console.log('---------------我的这个事data-----------',data);
    });*/


    //let bb = wea.getWeather();
    return this.display();};

  //定时任务，每1小时执行一次
  _default.prototype.taskAction = function taskAction() {
    var wea = require('../service/weaService');
    var cityList = this.post("cityList");
    var jobId = _nodeCrontab2['default'].scheduleJob('0 */1 * * *', function () {
      wea.getCityAll();});

    return this.display();};_default.prototype.


  getcitylistAction = function getcitylistAction() {
    var wea = require('../service/weaService');
    var list = [];
    wea.getCityAll1(this);};_default.prototype.


  addcityAction = function addcityAction() {
    var wea = require('../service/weaService');
    var name = this.get('name');
    var time = this.get('time');
    wea.addCity(name, time);
    return this.success("true");};


  /*testAction(data){
    console.log('---------------我的这个事data-----------',data);
    return this.success(list);
  }*/return _default;})(_baseJs2['default']);exports['default'] = _default;module.exports = exports['default'];